#include <stdio.h>
#define N 13

extern int Isleap(int year); 
extern int display_week(int year,int month,int day); 



void display_month(int year,int month)
{
	int i = 0;
	int num = 0;
	int m,n = 0;
	int j = 0;
	m = Isleap(year);
	int everymonth[N]={31,28,31,30,31,30,31,31,30,31,30,31};
	num = everymonth[month-1];
	if(m)
		everymonth[1] = everymonth[1] + 1;
	n = display_week(year,month,1);
	//printf("n:%d\n", n);
	//printf("month:%d\n", month);
	printf("----------------------------------------------------\n");
	printf("SUN\tMON\tTUE\tWED\tTHU\tFRI\tSAT\n");
	for(i=0;i<n;i++)
	{
		printf("\t");
		j++;
	}
	for(i=1;i <= num;++i)
	{
		printf("%d\t",i);
		j++;
		if(j%7 == 0 || i==num)
		{
			putchar('\n');
		}
	}
	printf("----------------------------------------------------\n");



}
